{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## [表示数值的字符串](https://github.com/CyC2018/CS-Notes/blob/master/notes/20.%20%E8%A1%A8%E7%A4%BA%E6%95%B0%E5%80%BC%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2.md)(code: java)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "示例：\n",
    "```\n",
    "true\n",
    "\n",
    "\"+100\"\n",
    "\"5e2\"\n",
    "\"-123\"\n",
    "\"3.1416\"\n",
    "\"-1E-16\"\n",
    "```\n",
    "----\n",
    "```\n",
    "false\n",
    "\n",
    "\"12e\"\n",
    "\"1a3.14\"\n",
    "\"1.2.3\"\n",
    "\"+-5\"\n",
    "\"12e+4.3\"\n",
    "```\n",
    "**解题思路：**\n",
    "\n",
    "使用正则表达式进行匹配。\n",
    "```\n",
    "[]  ： 字符集合\n",
    "()  ： 分组\n",
    "?   ： 重复 0 ~ 1 次\n",
    "+   ： 重复 1 ~ n 次\n",
    "*   ： 重复 0 ~ n 次\n",
    ".   ： 任意字符\n",
    "\\\\. ： 转义后的 .\n",
    "\\\\d ： 数字\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## [顺时针打印矩阵](https://github.com/CyC2018/CS-Notes/blob/master/notes/29.%20%E9%A1%BA%E6%97%B6%E9%92%88%E6%89%93%E5%8D%B0%E7%9F%A9%E9%98%B5.md)"
   ]
  },
  {
   "attachments": {
    "image.png": {
     "image/png": "iVBORw0KGgoAAAANSUhEUgAAASYAAAFPCAYAAADgP2NIAAAgAElEQVR4Ae2d2c/dxPnH8wdww0XFBUJCAnGBEEIEgRBUYpFAoiihXBSECEIghEQvaGkpJSqkIKBFLKJUokBBIlCqCv2SQHaykn0je0JWsu8LSxJ2kvnpM2VOJ36PfXzs8Rz7vN+R/NqvPR4/fjzP5zzzzIw9xChJA9KANFAzDQypmTwSRxqQBqQBIzCpEkgD0kDtNCAw1e6RS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fnpSXarAZp0xJiIBdF0o2eI4DXQAk6uOQV43IJ3wn48JhbgQxCYuBU9eoAJL4r4TxVQQnDAROzFje9hneyWH6yPWGAarE++j+4bAwdCBLmJB7EwQBJY0Zyjh4pYEnEjt+BZMYyA5h8LEKKXD7DRzU7zDqhVBSWnfkAJJN3i9g/2tcA02GtAn9w/AMG4gQneEjEmerDodQM6gMpBy60BEQsgojlIE47zKIOActVQ6hPVV3IbAlMlalWh0oA0UEYDAlMZ7elcaUAaqEQDAlMlalWh0oA0UEYD/w+A56XdCdrnBwAAAABJRU5ErkJggg=="
    }
   },
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "下图的矩阵顺时针打印结果为：1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10\n",
    "![image.png](attachment:image.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## [调整数组顺序使奇数位于偶数前面](https://github.com/CyC2018/CS-Notes/blob/master/notes/21.%20%E8%B0%83%E6%95%B4%E6%95%B0%E7%BB%84%E9%A1%BA%E5%BA%8F%E4%BD%BF%E5%A5%87%E6%95%B0%E4%BD%8D%E4%BA%8E%E5%81%B6%E6%95%B0%E5%89%8D%E9%9D%A2.md)"
   ]
  },
  {
   "attachments": {
    "image.png": {
     "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQ0AAAEVCAYAAAD6l7D+AAAgAElEQVR4Ae2dCZfVxNaG/bUyqswCgsgnKuBVUEFUFBWBKygiNDYzNMiMzKM0IjLKpIgToljfegr2uemQ9Ek6ldMnJ2/WCjlJKju73qp6sqsqHZ5wWqSAFJACORR4IkdaJZUCUkAKOEFDlUAKSIFcCggaueRSYikgBQQN1QEpIAVyKSBo5JJLiaWAFBA0VAekgBTIpYCgkUsuJZYCUkDQUB2QAlIglwKCRi65lFgKSAFBQ3VACkiBXAoIGrnkUmIpIAUEDdUBKSAFcikgaOSSS4mlgBQQNFQHpIAUyKVA6dA4fvy4e/fddyu1zp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Lkp8wXeuSXtCkx7/GWil4ZGOpzZRBI3TjgGHe49gxTshdhwgkT662swMtgEk57BLNIRd2ycf8XdP6C7RzSA99yC9LWjH2A7HuS9ANKCRzkBi6dO2gkaaMjpeSAEaPHAAGsyS2JgE3RT+whUQEEXwB11JC098IgjAQFrgQKPmaQs8GBzkHE9a9u0pnGTLjnE9g5nWmGk8NDAGFNO6N9i2Bpg2bmL2ASINkUbtGyZjKV995cdzaLC2EEEBqbSVN0OjC900gwW2gQeDmUmQi9uOQgOb6ERkQVfEbPEmqb2LEr1v2m9BI00ZHS+kAIOKdCGABlsqPk9k+vTsAwymWZP619yYys3bljYLAySIVrDBNYCH7g+2ot2NZk5zPeE9UOK6/roG2MJvoJE27hC/H34DIHzFfhQWlpY03Ddt5Xx8Mbv8URr+k4+kJcl2UjrujZ/92Uq6jmOCRpoyOl5IAZ7KPPWINogSbFqUysqLUEy/EnVExxDiN+Qc72AwbUrj5VrrtjDQim1mDjhe1sIfhPFEpnFpeaiAoKGaUIoCPAkZuGQ6lAbOzAWQ4OlGI6e70izcxwbpiU64hi0gIsoARLyzAUTSnrpFMsYTm64M3QzfjenqemyWooj9Kl8raFS59CrgO90UxjQYe6A7wgg+A5kABXBYFwEo2MpTneNEGqyAgQFBxkmYeQEaRB+MN5QBDGQFGvT17f0FtvGpzQrIX4qLgkYpssqoKUDjAxAMeDL+wMrLWYCELgozCYxdME5hKxEJU7F0aVgBBLMxQIepSrosAKcsYJjvQAyA2WrH674VNOpeA1qQfxo3DY+GTpTBmAYzDcyOAAQgYkCxLZBgBRJ0ceiWcB02GFwsGxgtkKWytxA0Klt0clwKDI4Cgsbg6K67SoHKKiBoVLbo5LgUGBwF/h/rNEt235D/owAAAABJRU5ErkJggg=="
    }
   },
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "需要保证奇数和奇数，偶数和偶数之间的相对位置不变。\n",
    "![image.png](attachment:image.png)\n",
    "方法一：创建一个新数组，时间复杂度 O(N)，空间复杂度 O(N)。\n",
    "\n",
    "方法二：使用冒泡思想，每次都将当前偶数上浮到当前最右边。时间复杂度 O(N2)，空间复杂度 O(1)，时间换空间。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## [数组中出现次数超过一半的数字](https://github.com/CyC2018/CS-Notes/blob/master/notes/39.%20%E6%95%B0%E7%BB%84%E4%B8%AD%E5%87%BA%E7%8E%B0%E6%AC%A1%E6%95%B0%E8%B6%85%E8%BF%87%E4%B8%80%E5%8D%8A%E7%9A%84%E6%95%B0%E5%AD%97.md)\n",
    "\n",
    "**解题思路：**\n",
    "思路二：数字次数超过一半，则说明：该数字出现的次数比其他数字之和还多\n",
    "\n",
    "　　遍历数组过程中保存两个值：一个是数组中某一数字，另一个是次数。遍历到下一个数字时，若与保存数字相同，则次数加1，反之减1。若次数=0，则保存下一个数字，次数重新设置为1。由于要找的数字出现的次数比其他数字之和还多，那么要找的数字肯定是最后一次把次数设置为1的数字。\n",
    "\n",
    "　　也可以这样理解（来源：牛客网 cm问前程）：\n",
    "\n",
    "　　采用阵地攻守的思想：\n",
    "```\n",
    "　　第一个数字作为第一个士兵，守阵地；count = 1；\n",
    "　　遇到相同元素，count++;\n",
    "　　遇到不相同元素，即为敌人，同归于尽,count--；当遇到count为0的情况，又以新的i值作为守阵地的士兵，继续下去，到最后还留在阵地上的士兵，有可能是主元素。\n",
    "　　再加一次循环，记录这个士兵的个数看是否大于数组一般即可。\n",
    " ```"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
